/**
 * 
 */
package sniper.wizard;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;

/**
 * @author Valerio Schiavoni
 *
 */
public class SniperWizard extends Wizard implements INewWizard {
	
	//wizard pages
	protected SniperFirstPage firstPage;
	
	//	flag indicated whether the wizard can be completed or not 
	// if the user has selected a target site to publish the code
	protected boolean sniperCompleted = false;

	//the workbench instance
	protected IWorkbench workbench;
	//workbench selection when the wizard was started
	private IStructuredSelection selection;

	
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
	 */
	@Override
	public boolean performFinish() {

		String summary = "todo";

		MessageDialog.openInformation(workbench.getActiveWorkbenchWindow()
				.getShell(), "Sniper info", summary);
		return true;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
	 */
	public void init(IWorkbench workbench, IStructuredSelection selection) {
		this.workbench = workbench;
		this.selection = selection;

	}
	
	@Override
	public void addPages()
	{
		firstPage = new SniperFirstPage(workbench, selection);
		addPage(firstPage);
		//add other pages here
	}

}
